home *** CD-ROM | disk | FTP | other *** search
- /* $VER: Terminus 2.0 - TerminusConfig.scp (03.07.93) */
-
- /*
- ** Copyright (C) 1992-3, John P. Radigan, All Rights Reserved, Worldwide.
- **
- ** This script is only executed if the Terminus session was unable
- ** to find a defaults, phonebook and startup script. It will help you
- ** configure the serial device and modem for use with the session that
- ** called it.
- **
- ** If you find any aspects of this script to be lacking due to a
- ** feature that your modem has that has been overlooked, or you feel
- ** that it's utility can be enhanced in some way please feel free to
- ** document any changes you've made to this script and send it to the
- ** support BBS or P.O. Box so that the changes can be added to the next
- ** release of Terminus.
- **
- */
-
- devname$ = "serial.device"
- devunit = 0
-
- restart:
- goto main
-
- print local "\n ";
- gosub get_ans
-
- if ans$ == "Y"
- endif
-
- _cmd$ = ""
- input local "\n []: ", ans$
- if len(ans$)
- _cmd$ = ans$
- endif
-
- send_cmd:
- send modem_cmd$
- ontimeout goto not_ok
- wait 5, ok_res$
- ontimeout
- return
-
- not_ok:
- print local "Modem did not respond or an error occured, retry";
- gosub get_ans
-
- if ans$ == "Y"
- pop
- goto restart
- endif
- end
-
- cont:
- ask local "\nPress any key to continue ", ans$
- print local
- return
-
- get_ans:
- ask local " [Y]/n? ", ans$
- print local
- ans$ = trim$(upper$(ans$))
- if ans$ != "N"
- ans$ = "Y"
- endif
- return
-
- main:
- cls
- print local "\n ******* *"
- print local " *"
- print local " * **** * *** **** *** * **** * * ****"
- print local " * * * ** * * * * * * * * * *"
- print local " * ****** * * * * * * * * * ****"
- print local " * * * * * * * * * * * *"
- print local " * **** * * * * * * * **** ****"
-
- print local "\n Welcome to the Terminus modem configuration script. The purpose of this"
- print local "script is to help you configure Terminus and your modem with a minimum of"
- print local "fuss and to insure that they will work together properly when dialing and"
- print local "transfering data."
-
- print local "\n Due to the many differences between today's high speed modems as well as"
- print local "with some of the less sophisticated models of a few years ago, this script"
- print local "tries to be as generic as possible so that most any modem can be configured."
- print local "Because of this, any features unique to your modem will be left in a factory"
- print local "default state, you will have to adjust these settings after the script"
- print local "completes.\n\n Proceed with modem configuration";
- gosub get_ans
-
- if ans$ == "N"
- end
- endif
-
- get_port:
- cls
- print local "\n\n The first thing to do is to define the serial device driver and the"
- print local "unit that Terminus will use to communicate with your modem. The current"
- print local "driver and unit are:"
-
- show_port:
- print local "\n Device: \""; devname$; "\""
- print local " Unit: "; devunit
- print local "\n Is this the correct device and unit";
- gosub get_ans
-
- if ans$ == "N"
- print local "\n Please remember that AmigaDOS is case sensitive when it comes to"
- print local "device names, please enter the name of the driver as it exists on disk."
- gosub cont
- getstring "Enter the device driver you want to use", devname$
- getint "Enter the unit number for this device", devunit, 0, 9999
- goto show_port
- endif
-
- serdev$ = devname$ + " " + str$(devunit)
-
- get_baud:
- cls
- print local "\n\n Now select the default baud rate to use:"
- print local "\n\n 1. 300"
- print local " 2. 600"
- print local " 3. 1200"
- print local " 4. 2400"
- print local " 5. 4800"
- print local " 6. 9600"
- print local " 7. 19200"
- print local " 8. 31250 (MIDI)"
- print local " 9. 38400"
- print local " 10. 57600"
- print local " 11. 115200"
- input local "\n Your choice: ", ans
-
- if ans < 1 AND ans > 11
- print local "Invalid choice, reenter."
- wait 2
- goto get_baud
- endif
-
- if ans == 1
- baud = 300
- goto set_modem
- endif
-
- if ans == 2
- baud = 600
- goto set_modem
- endif
-
- if ans == 3
- baud = 1200
- goto set_modem
- endif
-
- if ans == 4
- baud = 2400
- goto set_modem
- endif
-
- if ans == 5
- baud = 4800
- goto set_modem
- endif
-
- if ans == 6
- baud = 9600
- goto set_modem
- endif
-
- if ans == 7
- baud = 19200
- goto set_modem
- endif
-
- if ans == 8
- baud = 31250
- goto set_modem
- endif
-
- if ans == 9
- baud = 38400
- goto set_modem
- endif
-
- if ans == 10
- baud = 57600
- goto set_modem
- endif
-
- if ans == 11
- baud = 115200
- endif
-
- set_modem:
- cls
- print local "\n\nDoes your modem have dip switches";
- gosub get_ans
- if ans$ == "Y"
- print local "\n\n Although the types of modems and their dip switch settings often vary"
- print local "considerably between each model, the following are typical options that"
- print local "are usually assigned to modem dip switches. Please consult your modem"
- print local "reference manual to insure that correct switches are changed as needed."
- print local "\n - DSR forced on."
- print local " - DTR, CTS, RTS and DCD should function normally, not forced on."
- print local " - Verbose (word) modem responses instead of terse (digit)."
- print local " - Command mode, echo and responses enabled, not suppressed."
- print local " - Escape code (+++) should drop to command mode."
- print local " - Hayes compatible AT command set allowed."
- print local " - Load NVRAM settings when powered on."
- print local " - Automatic answer mode disabled."
- print local "\n Again, these are typical dip switch options, your modem may differ in"
- print local "the ones it supports."
- gosub cont
-
- if ans$ == "N"
- end
- endif
- cls
- endif
-
- print local "\n\n You're now ready to configure your modem, please have the reference"
- print local "manual (or hardcard) handy so that you can consult it when answering the"
- print local "following questions. Items in [] brackets are the default values,"
- print local "press <RETURN> to use that value."
-
- print local "\nDoes your modem have nonvolatile memory (NVRAM)";
- gosub get_ans
- nvram$ = ans$
-
- print local "\nDoes your modem support error correction";
- gosub get_ans
- mnp4$ = ans$
-
- print local "\nDoes your modem support data compression";
- gosub get_ans
- mnp5$ = ans$
-
- at_cmd$ = "AT"
- getstring "What is the modem attention code", at_cmd$
-
- reset_cmd$ = "Z"
- getstring "Modem reset command", reset_cmd$
-
- modempostfix$ = "^M"
- getstring "Postfix character to send a modem command", modempostfix$
-
- ok_res$ = "OK"
- getstring "OK result code", ok_res$
-
- responseok$ = ok_res$
-
- print local "\nAttempting to reset modem.\n"
- modem_cmd$ = at_cmd$ + reset_cmd$ + modempostfix$
- gosub send_cmd
-
- print local "\n Does your modem have a factory default command";
- gosub get_ans
-
- if ans$ == "Y"
- facdef_cmd$ = "&F"
- getstring "Factory default command", facdef_cmd$
- print local "\nAttempting to reset modem.\n"
- modem_cmd$ = at_cmd$ + facdef_cmd$ + modempostfix$
- gosub send_cmd
- endif
-
- if nvram$ == "Y"
- save_cmd$ = "&W"
- getstring "Write to NVRAM command", save_cmd$
- print local "\nAttempting to save to ram.\n"
- modem_cmd$ = at_cmd$ + save_cmd$ + modempostfix$
- gosub send_cmd
- endif
-
- echo_cmd$ = "E1"
- getstring "What turns on command echo", echo_cmd$
-
- result_cmd$ = "Q0"
- getstring "Command that returns result codes", result_cmd$
-
- verb_cmd$ = "V1"
- getstring "Command that selects verbal result codes:", verb_cmd$
-
- x_cmd$ = "X4"
- getstring "Command to return extended result codes", x_cmd$
-
- blind_cmd$ = ""
- print local "\nDoes your modem have a wait-for-dialtone dial mode";
- gosub get_ans
-
- if ans$ == "Y"
- getstring "Command to allow use wait-for-dialtone dialing:", blind_cmd$
- endif
-
- dcd_cmd$ = ""
- print local "\nDoes your modem have a DCD control command";
- gosub get_ans
-
- if ans$ == "Y"
- dcd_cmd$ = "&C1"
- getstring "Command to allow DCD to function normally", dcd_cmd$
- endif
-
- dtr_cmd$ = ""
- dtrhangup = FALSE
- print local "\n Does your modem support dropping DTR to hangup";
- gosub get_ans
-
- if ans$ == "Y"
- dtr_cmd$ = "&D2"
- getstring "Command to allow DTR to function normally:", dtr_cmd$
- dtrhangup = TRUE
- modemhangupcmd$ = ""
- else
- hang_cmd$ = "H"
- getstring "On hook command (hang up modem)", hang_cmd$
-
- plus_cmd$ = "+++"
- getstring "Escape sequence to return to command state:", plus_cmd$
- modemhangupcmd$ = "~~~" + plus_cmd$ + "~~~" + at_cmd$ + hang_cmd$ + modempostfix$
- endif
-
- print local "\n If there are any remaining commands that need to be sent to the"
- print local "modem, please enter them now."
- gosub cont
-
- extra_cmd$ = ""
- getstring "Please enter miscellaneous commands", extra_cmd$
-
- if nvram$ == "Y"
- print local "\nConfiguring basic modem settings.\n"
- modeminitcmd$ = at_cmd$ + reset_cmd$ + modempostfix$
- modem_cmd$ = modeminitcmd$
- gosub send_cmd
- modem_cmd$ = at_cmd$ + echo_cmd$ + result_cmd$ + verb_cmd$ + x_cmd$ + dcd_cmd$ + dtr_cmd$ + extra_cmd$ + save_cmd$ + modempostfix$
- gosub send_cmd
- else
- modeminitcmd$ = at_cmd$ + reset_cmd$ + modempostfix$ + "~~~" + at_cmd$ + echo_cmd$ + result_cmd$ + verb_cmd$ + x_cmd$ + dcd_cmd$ + dtr_cmd$ + modempostfix$
- endif
-
- dial_cmd$ = "DT"
- getstring "What is the dial command:", dial_cmd$
-
- modemprefix1$ = at_cmd$
- modemprefix2$ = at_cmd$
- modemprefix3$ = at_cmd$
- modemprefix4$ = at_cmd$
-
- if mnp4$ == "Y"
- mnp4on_cmd$ = ""
- getstring "What command enables error correction", mnp4on_cmd$
- modemprefix1$ = modemprefix1$ + mnp4on_cmd$
- modemprefix2$ = modemprefix2$ + mnp4on_cmd$
- mnp4off_cmd$ = ""
- getstring "What command disables error correction:", mnp4off_cmd$
- modemprefix3$ = modemprefix3$ + mnp4off_cmd$
- endif
-
- if mnp5$ == "Y"
- mnp5on_cmd$ = ""
- getstring "What command enables data compression", mnp5on_cmd$
- modemprefix1$ = modemprefix1$ + mnp5on_cmd$
- mnp5off_cmd$ = ""
- getstring "What command disables data compression:", mnp5off_cmd$
- modemprefix2$ = modemprefix2$ + mnp5off_cmd$
- modemprefix3$ = modemprefix3$ + mnp5off_cmd$
- endif
-
- modemprefix1$ = modemprefix1$ + dial_cmd$
- modemprefix2$ = modemprefix2$ + dial_cmd$
- modemprefix3$ = modemprefix3$ + dial_cmd$
- modemprefix4$ = modemprefix4$ + dial_cmd$
-
- if mnp4$ == "Y" or mnp5$ == "Y"
- cls
- print local "\n\n The dialing prefixes have now been configured as follows"
- print local "\n Prefix1 - Enables error correction and data compression if"
- print local "\n Prefix2 - Enables error correction, disables data compression."
- print local "\n Prefix3 - Disables error correction and data compression."
- print local "\n Prefix4 - Same as Prefix1."
- gosub cont
- endif
-
- cls
- print local "\n The next phase of modem configuration requires the entry of the various"
- print local "response codes that the modem can return during dialing. If your modem does"
- print local "not support one or more of the following codes you can leave it as is or you"
- print local "can erase the default string that is supplied by Terminus."
-
- print local "\n There is one response code, \"RING\" that is normally left blank by"
- print local "default. If your modem is used on a phone line that is often receiving"
- print local "incoming calls you may want to put the appropriate response in order to"
- print local "allow the dialer to stop dialing when it recognizes an incoming call."
-
- print local "\n One other thing to keep in mind concering the \"RING\" response is that"
- print local "some modems return a \"RINGING\" response prior to the remote end going off"
- print local "hook. Since \"RING\" is a subset of \"RINGING\", a false detection would"
- print local "occur by Terminus. This is why the string is left blank by default. If you"
- print local "do enter something, please be sure that it will not cause a detection"
- print local "collision by using a string such as \"RING^M\" or whatever the modem returns"
- print local "for that response.\n"
- gosub cont
-
- getstring "BUSY result code", responsebusy$
- getstring "CONNECT result code", responseconnect$
- getstring "ERROR result code", responseerror$
- getstring "NO CARRIER result code", responsenocarrier$
- getstring "NO DIALTONE result code", responsenodialtone$
- getstring "RING result code", responsering$
- getstring "VOICE result code", responsevoice$
-
- if mnp4$ == "Y" or mnp5$ == "Y"
- cls
- print local "\n\n Your modem requires additional configuration for hardware flow control,"
- print local "also called \"CTS/RTS\" handshaking. This is needed since an error"
- print local "correcting modem needs to operate at a fixed baud rate that is higher"
- print local "than it's maximum connect rate in order for error correction to work"
- print local "as efficiently as possible."
- print local "\n The following questions do not have default settings as each modem"
- print local "will most likely use a different command for each function that the"
- print local "question asks you. If your modem does not support that particular"
- print local "command, just press <ENTER> and continue on to the next command. If"
- print local "several commands are needed to accomplish the function that the question"
- print local "asks enter them consecutively prior to pressing <RETURN>."
- print local "\n If at the end of the questions you feel that certain commands have"
- print local "not been entered, you will have a chance to enter these in one string"
- print local "to send to the modem for configuring."
- print local "\n The first command required is the one that will force the modem to"
- print local "fix the baud rate between the modem and computer, called the \"DTE rate\","
- print local "some modems call this \"Baud Adjust\" or something similar."
- gosub cont
-
- fixed_cmd$ = ""
- getstring "Please enter the command that locks the DTE baud rate:", fixed_cmd$
-
- print local "\n\n The next command to enter is the one that permanently sets the DSR"
- print local "signal line. This is required so that the Amiga serial.device can use"
- print local "hardware flow control."
- gosub cont
-
- dsr_cmd$ = ""
- getstring "Please enter the command that forces DSR on", dsr_cmd$
-
- print local "\n\n The next command controls the transmission of data. Please use the"
- print local "command that activates CTS flow control and does not activate XON/XOFF"
- print local "flow control for transmitted data."
- gosub cont
-
- cts_cmd$ = ""
- getstring "Please enter the command for transmit flow control:", cts_cmd$
-
- print local "\n\n The next command is for recieved data flow control via the RTS line."
- print local "Please use the command that activates RTS flow control and disables "
- print local "XON/XOFF flow control for received data."
- gosub cont
-
- rts_cmd$ = ""
- getstring "Please enter the command for receive flow control", rts_cmd$
-
- print local "\n\n If your modem has a seperate command for software flow control, also"
- print local "called \"XON/XOFF\" handshaking, please enter the command that disables"
- print local "it as Terminus needs complete data transparency for file transfers to"
- print local "work correctly."
- gosub cont
-
- xoff_cmd$ = ""
- getstring "Please enter the command to disable \"XON/XOFF\" flow control:", xoff_cmd$
-
- print local "\n Since error correcting modems have an internal buffer they often can"
- print local "clear the buffer when a break signal is sent. If your modem has such a"
- print local "command, please enter the one that will clear the buffer and also send"
- print local "the break signal to the remote system."
- gosub cont
-
- break_cmd$ = ""
- getstring "Please enter the command to clear buffer and send a break", break_cmd$
-
- print local "\n If there are any remaining commands that need to be sent to the"
- print local "modem, please enter them now."
- gosub cont
-
- extra_cmd$ = ""
- getstring "Please enter miscellaneous commands", extra_cmd$
-
- if nvram$ == "Y"
- print local "\nConfiguring advanced modem settings.\n"
- modem_cmd$ = at_cmd$ + fixed_cmd$ + dsr_cmd$ + cts_cmd$ + rts_cmd$ + xoff_cmd$ + break_cmd$ + extra_cmd$ + save_cmd$ + modempostfix$
- gosub send_cmd
- else
- print local " Please reenter your modem commands, an error correcting modem should"
- print local "have an NVRAM command to save the settings for future use."
- gosub cont
- goto set_modem
- endif
- endif
-
- sdefaults
- cls
- print local "\n\n\n Your modem should now be configured for use with Terminus. The"
- print local "current Terminus settings have been saved to your defaults file.\n\n"
- end
-